
//jquery Ajax请求
const request = (url, data) => new Promise((resolve) => {
    $.ajax({
        url,
        data,
        dataType: 'json',
        success: resolve,
    })
}
)

let BaseUrl= location.href.includes('http://127.0.0.1') ? 'http://localhost' : 'http://weixiao0.gz01.bdysite.com';


//注册接口
export const APIRegister = data => request(`${BaseUrl}/nets/register.php`, data);
//登录接口
export const APILogin = data => request(`${BaseUrl}/nets/login.php`, data);
//用户检测接口
export const APICheckUser = data => request(`${BaseUrl}/nets/checkuser.php`, data);
//修改密码接口
export const APIUserUpData = data => request(`${BaseUrl}/nets/user-update.php`, data);
//商品轮播接口
export const APIGoodsSwi = data => request(`${BaseUrl}/nets/goodslist.php`, data);
//模糊查询接口
export const APIGoodsList = data => request(`${BaseUrl}/nets/goods-list.php`, data);
//商品详情接口
export const APIGoodsDetail = data => request(`${BaseUrl}/nets/good-detail.php`, data);
//添加购物车
export const APICartAdd = data => request(`${BaseUrl}/nets/cart-add.php`, data);
//购物车列表
export const APICartList = data => request(`${BaseUrl}/nets/cart-list.php`, data);
//购物车修改数量
export const APICartUpdate = data => request(`${BaseUrl}/nets/cart-updata.php`, data);
//购物车删除
export const APICartDel = data => request(`${BaseUrl}/nets/cart-del.php`, data);


